﻿<?php 
$v_url = "/record/handle/index.php?modal_dialog_mode=1" . "&hdn_record_work_id=" . $v_record_work_id . "&fuseaction=DISPLAY_NOTIFY" ;
$v_recordtype_filter =$_SESSION['onegate_current_recordtype'];
if(isset($_REQUEST['hdn_recordtype_filter'])){
	$v_recordtype_filter = $_REQUEST['hdn_recordtype_filter'];
}
$v_record_work_id = intval($_REQUEST['hdn_item_id']);

$v_record_id = $arr_single_record['PK_RECORD'];
//echo "<br/>.....".$v_record_id;exit;
//ID nguoi thuc hien cong viec
$v_worker_id = _get_item_attr_by_id($_SESSION['arr_all_staff'],$_SESSION['staff_id'],'id');
$v_worktype='NOI_DUNG_THONG_BAO_THUE';
//$v_date= _ddmmyyyy_to_yyyymmdd($_REQUEST['txt_date']);
$v_date=date('Y-m-d');
$v_result =  _replace_bad_char($_REQUEST['txt_result']);
$v_file_id = 0;	
//CSDL SQL
if(_is_sqlserver()){
	$v_result_id = _save_text_to_database('T_TEMP_FILE', 'C_TEXT', $v_result);
	/*
	if(kiem_tra(id_record,'NOI_DUNG_THONG_BAO_THUE')co nam table(T_ONEGATE_RECORD_WORK)){
			
	}
	*/
	if($v_pk_record_work==0){
	$sql = "Exec Onegate_RecordWorkUpdate " ;
	$sql = $sql . $v_record_work_id;
	$sql = $sql . "," . $v_record_id ;
	$sql = $sql . "," . $v_worker_id;//ID nguoi thuc hien cong viec
	$sql = $sql . ",'" . $v_worktype . "'";
	$sql = $sql . ",'" . $v_date."'";
	$sql = $sql . "," . $v_result_id ;
	$sql = $sql . "," . $v_file_id;
	$sql = $sql . ",'" ."Ox"."'";
	$sql = $sql . "," . _CONST_STATUS_UPDATE_DATE ;
	$ado_conn->SetFetchMode(ADODB_FETCH_ASSOC);
	$rs = $ado_conn->GetRow($sql); 
	$v_error = _replace_bad_char(trim($rs['RET_ERROR']));
	}
	//echo "<br/>".$sql;exit;
}
